package ae.pcfc.cldos.online.common.clddb.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.envers.Audited;

import ae.pcfc.cldos.online.common.domain.BaseEntity;


/**
 * The persistent class for the T_CLDOS_MESSAGE_INBOX database table.
 * 
 */
@Entity
@Table(name="T_CLDOS_MESSAGE_INBOX")
@Audited
@SequenceGenerator(name = "SQ_CLDOS_MSG_ID", sequenceName = "SQ_CLDOS_MSG_ID", initialValue = 1, allocationSize = 1)
public class MessageInbox extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String MESSAGE_TYPE = "miMsgType";
	
	public static final String __ID = "miMsgId";
	
	public static final String __MESSAGE_SEND_ON = "miSentOn";
	
	public static final String MESSAGE_TYPE_TASK = "TASK";
	public static final String MESSAGE_TYPE_NOTIFICATION = "NOTIFICATION";
	
	public static final String ACTION_FLAG = "miActionFlag";
	
	public static final String MESSAGE_ACTION_FLAG_DONE = "DONE";
	public static final String MESSAGE_ACTION_FLAG_NOT_DONE = "NOT_DONE";
	
	public static final String APP_META_DATA = "AppMetaData";
	
	public static final String __APP_ID = "appId";
	
	public static final String __TASK_CODE = "tackNameCode";
	public static final String __TASK_TYPE_ALL = "ALL";
	public static final String __TASK_TYPE_ADMIN  = "ADMIN";
	
	public static final String __TASK_MASTER = "TaskMaster";
	
	public static final String __APPLICATION_ATTACHMENTS = "applicationAttachments";
	
	@Id
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator="SQ_CLDOS_MSG_ID")
	@Column(name="MI_MSG_ID")
	private Long miMsgId;

	@Column(name="MI_ACTION_FLAG")
	private String miActionFlag;

	@Column(name="MI_APPROVER_ID")
	private String miApproverId;

	@Column(name="MI_ATTACHMENT_PATH")
	private String miAttachmentPath;

	@Column(name="MI_DTLS")
	private String miDtls;

	@Column(name="MI_DTLS_ARB")
	private String miDtlsAr;
	
	@Column(name="MI_MSG_TYPE")
	private String miMsgType;

    @Temporal( TemporalType.DATE)
	@Column(name="MI_RCVD_ON")
	private Date miRcvdOn;

    @Temporal( TemporalType.DATE)
	@Column(name="MI_SENT_ON")
	private Date miSentOn;

	@Column(name="MI_SUBJECT")
	private String miSubject;
	
	@Column(name="MI_SUBJECT_ARB")
	private String miSubjectAr;

	@Column(name="MI_SUBMITTER_ID")
	private String miSubmitterId;
	
	@Column(name="APPLICATION_ID")
	private Long appId;

	//bi-directional many-to-one association to MessageAttachment
	@OneToMany(mappedBy="MessageInbox")
	private List<MessageAttachment> MessageAttachments;

	//bi-directional many-to-one association to AppMetaData
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="APPLICATION_ID", insertable=false, updatable=false)
	private AppMetaData AppMetaData;

	//bi-directional many-to-one association to ApplicationStatus
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="STATUS_CODE")
	private ApplicationStatus ApplicationStatus;

	@Column(name="TASK_CODE")
	private Long tackNameCode;
	
	//bi-directional many-to-one association to TaskMaster
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="TASK_CODE", insertable=false, updatable=false)
	private TaskMaster TaskMaster;
	
	@OneToMany(mappedBy="messageInbox", fetch=FetchType.LAZY)
	private List<ApplicationAttachment> applicationAttachments;

    public MessageInbox() {
    }

	public Long getMiMsgId() {
		return this.miMsgId;
	}

	public void setMiMsgId(Long miMsgId) {
		this.miMsgId = miMsgId;
	}

	public String getMiActionFlag() {
		return this.miActionFlag;
	}

	public void setMiActionFlag(String miActionFlag) {
		this.miActionFlag = miActionFlag;
	}

	public String getMiApproverId() {
		return this.miApproverId;
	}

	public void setMiApproverId(String miApproverId) {
		this.miApproverId = miApproverId;
	}

	public String getMiAttachmentPath() {
		return this.miAttachmentPath;
	}

	public void setMiAttachmentPath(String miAttachmentPath) {
		this.miAttachmentPath = miAttachmentPath;
	}

	public String getMiDtls() {
		return this.miDtls;
	}

	public void setMiDtls(String miDtls) {
		this.miDtls = miDtls;
	}

	public String getMiDtlsAr() {
		return miDtlsAr;
	}

	public void setMiDtlsAr(String miDtlsAr) {
		this.miDtlsAr = miDtlsAr;
	}

	public String getMiMsgType() {
		return this.miMsgType;
	}

	public void setMiMsgType(String miMsgType) {
		this.miMsgType = miMsgType;
	}

	public Date getMiRcvdOn() {
		return this.miRcvdOn;
	}

	public void setMiRcvdOn(Date miRcvdOn) {
		this.miRcvdOn = miRcvdOn;
	}

	public Date getMiSentOn() {
		return this.miSentOn;
	}

	public void setMiSentOn(Date miSentOn) {
		this.miSentOn = miSentOn;
	}

	public String getMiSubject() {
		return this.miSubject;
	}

	public void setMiSubject(String miSubject) {
		this.miSubject = miSubject;
	}

	public String getMiSubjectAr() {
		return miSubjectAr;
	}

	public void setMiSubjectAr(String miSubjectAr) {
		this.miSubjectAr = miSubjectAr;
	}

	public String getMiSubmitterId() {
		return this.miSubmitterId;
	}

	public void setMiSubmitterId(String miSubmitterId) {
		this.miSubmitterId = miSubmitterId;
	}

	public List<MessageAttachment> getMessageAttachments() {
		return this.MessageAttachments;
	}

	public void setMessageAttachments(List<MessageAttachment> MessageAttachments) {
		this.MessageAttachments = MessageAttachments;
	}
	
	public AppMetaData getAppMetaData() {
		return this.AppMetaData;
	}

	public void setAppMetaData(AppMetaData AppMetaData) {
		this.AppMetaData = AppMetaData;
	}
	
	public ApplicationStatus getApplicationStatus() {
		return this.ApplicationStatus;
	}

	public void setApplicationStatus(ApplicationStatus ApplicationStatus) {
		this.ApplicationStatus = ApplicationStatus;
	}
	
	public TaskMaster getTaskMaster() {
		return this.TaskMaster;
	}

	public void setTaskMaster(TaskMaster TaskMaster) {
		this.TaskMaster = TaskMaster;
	}

	public Long getTackNameCode() {
		return tackNameCode;
	}

	public void setTackNameCode(Long tackNameCode) {
		this.tackNameCode = tackNameCode;
	}

	public Long getAppId() {
		return appId;
	}

	public void setAppId(Long appId) {
		this.appId = appId;
	}

	public List<ApplicationAttachment> getApplicationAttachments() {
		return applicationAttachments;
	}

	public void setApplicationAttachments(List<ApplicationAttachment> applicationAttachments) {
		this.applicationAttachments = applicationAttachments;
	}
	
}